package com.sunsy.authserver.wrapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sunsy.authserver.beans.po.AppClient;
import com.sunsy.authserver.beans.vo.AppClientVO;
import com.sunsy.authserver.beans.dto.AppClientDTO;
import cn.hutool.core.bean.BeanUtil;

/**
 * (AppClient)表包装类
 *
 * @author makejava
 * @since 2021-07-20 14:34:11
 */
public class AppClientWrapper extends AbstractWrapper<AppClient, AppClientVO, AppClientDTO>{

  public static AppClientWrapper build() {
    return new AppClientWrapper();
  }

  /**
   * dto转queryWrapper
   *
   * @param dto 交互数据
   * @return 查询Wrapper
   */
  @Override
  public QueryWrapper<AppClient> dto2QWrapper(AppClientDTO dto) {
    AppClient po = dto2PO(dto);
    return new QueryWrapper<>(po);
  }

  /**
   * dto转po
   *
   * @param dto 交互数据
   * @return AppClient 实体对象
   */
  @Override
  public AppClient dto2PO(AppClientDTO dto) {
    return BeanUtil.copyProperties(dto, AppClient.class);
  }

  /**
   * po转vo
   *
   * @param po 实体对象
   * @return AppClient 实体展示对象
   */
  @Override
  public AppClientVO po2VO(AppClient po) {
    return BeanUtil.copyProperties(po, AppClientVO.class);
  }

}